package com.esri.core.map;

import com.esri.core.internal.util.d;
import com.esri.core.map.LayerSource;
import java.io.IOException;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;

/* loaded from: classes.dex */
public class LayerMapSource extends LayerSource {
    private int a;
    private String b = "";

    public LayerMapSource(int i) {
        a(LayerSource.LayerType.MAPLAYER);
        this.a = i;
    }

    public int getLayerId() {
        return this.a;
    }

    public void setLayerId(int i) {
        this.a = i;
    }

    public String getVersionName() {
        return this.b;
    }

    public void setVersionName(String str) {
        this.b = str;
    }

    @Override // com.esri.core.map.LayerSource
    public String toJson() throws IOException {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a = d.a(stringWriter);
        a.writeStartObject();
        a.writeStringField("type", getType().toString());
        a.writeNumberField("mapLayerId", this.a);
        a.writeStringField("version", this.b);
        a.writeEndObject();
        a.close();
        return stringWriter.toString();
    }

    public String toString() {
        return "LayerMapSource [" + super.toString() + ",layerId=" + this.a + ", versionName=" + this.b + "]";
    }
}
